<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
    *{
        margin: 0;
        padding: 0;

    }
    div{
        line-height: 35px;

    }
    li{
        width: 24px;
        height: 24px;
        background: url(img\star_fill.png) no-repeat;
        background-size: 24px 24px;
        float: left;
        list-style: none;
        margin: 5px;
        cursor: pointer;
    }
</style>
<body>
    <div>
        <ul>
            <li></li>
            <li></li>
            <li></li>
            <li></li>
            <li></li>
        </ul>
        <span></span>
    </div>
</body>
<script src="./jquery.js"></script>
<script>
    var oldIndex = -1;
    var timer = null;
    $('li').mouseover(function(){
        clearTimeout(timer);
        var index = $(this).index();
        $('li').slice(0,index+1).css('background-image','url(star_fill.png)');
        $('li').slice(index+1).css('background-image','url(star.png)');
    }).mouseout(function(){
        timer = setTimeout(function(){
            $('li').slice(0,oldIndex+1).css('background-image','url(star_fill.png)')
        $('li').slice(oldIndex+1).css('background-image','url(star.png)')
        },200);
      
    })
    $("li").click(function(){
        oldIndex = $(this).index()
    })
    </script>
</html>